import request from '@/utils/request'

// 查询当前库存列表
export function listWareCurrentStock(query) {
  return request({
    url: '/warehouse/WareCurrentStock/list',
    method: 'get',
    params: query
  })
}

// 查询总库当前库存列表
export function listWareCurrentStockMain(query) {
  return request({
    url: '/warehouse/WareCurrentStock/mainList',
    method: 'get',
    params: query
  })
}


// 查询工具库当前库存列表
export function listWareCurrentStockTool(query) {
  return request({
    url: '/warehouse/WareCurrentStock/toolList',
    method: 'get',
    params: query
  })
}

// 根据仓库id查询当前仓库中的物品
export function getInventoryByDepotId(depotId) {
  return request({
    url: '/warehouse/WareCurrentStock/getInventoryByDepotId/' + depotId ,
    method: 'get'
  })
}

//根据仓库id和物品id查询仓库中物品基本信息和当前库存
export function getInfoByDepotInventoryId(params) {
  return request({
    url: '/warehouse/WareCurrentStock/getInfoByDepotInventoryId',
    method: 'get',
    params: params
  })
}

// 查询当前库存详细
export function getWareCurrentStock(id) {
  return request({
    url: '/warehouse/WareCurrentStock/' + id,
    method: 'get'
  })
}

// 新增当前库存
export function addWareCurrentStock(data) {
  return request({
    url: '/warehouse/WareCurrentStock',
    method: 'post',
    data: data
  })
}

// 修改当前库存
export function updateWareCurrentStock(data) {
  return request({
    url: '/warehouse/WareCurrentStock',
    method: 'put',
    data: data
  })
}

// 删除当前库存
export function delWareCurrentStock(id) {
  return request({
    url: '/warehouse/WareCurrentStock/' + id,
    method: 'delete'
  })
}
